package cn.xd.base.domain.bean.response;

import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * @author Mirza Lin
 * @date 2021/11/23
 */
@Data
public class JsonAdminMenuTree implements Serializable {
    /**
     * id
     */
    private Long id;
    /**
     * 父菜单ID
     */
    private Long parentId;
    /**
     * 菜单编码
     */
    private String menuCode;
    /**
     * 菜单地址
     */
    private String router;
    /**
     * 权限标识
     */
    private String perms;

    /**
     * 菜单类型（字典）
     */
    private Integer type;

    /**
     * 图标
     */
    private String icon;

    /**
     * 排序
     */
    private Integer orderNum;

    /**
     * 视图地址
     */
    private String viewPath;

    /**
     * 路由缓存
     */
    private Boolean keepAlive;
    /**
     * 是否显示
     */
    private Boolean display;
    private List<JsonAdminMenuTree> children;

    public JsonAdminMenuTree(AdminMenuDTO dto) {
        this.id = dto.getId();
        this.parentId = dto.getParentId();
        this.menuCode = dto.getMenuCode();
        this.router = dto.getRouter();
        this.perms = dto.getPerms();
        this.type = dto.getType();
        this.icon = dto.getIcon();
        this.orderNum = dto.getOrderNum();
        this.viewPath = dto.getViewPath();
        this.keepAlive = dto.getKeepAlive();
        this.display = dto.getDisplay();
    }
}
